package com.guomao.demoe;

public class JavaDemo {

    public static void main(String[] args) {

        //1 匿名内部类
        LengthCheker lc1 = new LengthCheker() {
            @Override
            public int length(String text) {
                return text.length();
            }
        };

        //2 lambda
        LengthCheker lc2 = (String s) -> {
            return s.length();
        };

        LengthCheker lc3 = s -> s.length();

        LengthCheker lc4 = String::length;
    }
}
